#pragma once
#define CRT_SECURE_NO_WARNINGS
#include <stdio.h>
#include <stdlib.h>
#include <assert.h>

typedef int typedata;

typedef struct HEAP
{
	typedata* arr;
	int size;
	int capacity;
}HP;


void HPinit(HP* hp);
void HPpush_small(HP* hp,typedata x);
int HPpop_small(HP* hp);

void HPpush_big(HP* hp, typedata x);
int HPpop_big(HP* hp);

void adjust_up(typedata* arr, int size);
void adjust_down(typedata* arr, int size);

void HP_small_up(typedata* arr, int size);
void HP_big_up(typedata* arr, int size);

void HP_Destory(HP* hp);

typedata HP_Top(HP* hp);

int HP_Size(HP* hp);

int HP_Empty(HP* hp);